package com.gitee.swsk33.demoserviceorder.feignclient;

import com.gitee.swsk33.demoentity.dataobject.User;
import com.gitee.swsk33.demoentity.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 远程调用用户服务模块的Feign客户端
 */
@FeignClient(name = "user-service", path = "/api/user", contextId = "user-client")
public interface UserClient {

	@GetMapping("/get/{id}")
	Result<User> getById(@PathVariable int id);

	@GetMapping("/get-all")
	Result<List<User>> getAll();

}